package com.md.lesson6;

import java.util.Scanner;

public class WhileTest3 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		
		double score;
		double sum = 0;
		int i = 1;
		while(i<=5) {
			System.out.println("请输入第"+ i +"个成绩：");
			score = s.nextDouble();
			if(score < 0 || score > 100) {
				System.out.println("输入错误");
				continue;
			}else {
				sum += score;
			}
			++i;
		}
		System.out.println("总和：" + sum);

	}

}
